<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>设备监控管理</title>
<!-- Tell the browser to be responsive to screen width -->
<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="../../../bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet"
	href="//cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/zTree.v3/3.5.23/css/zTreeStyle/zTreeStyle.min.css">
<!-- DataTables -->
<link rel="stylesheet"
	href="../../../plugins/datatables/dataTables.bootstrap.css">
<!-- Theme style -->
<link rel="stylesheet" href="../../../dist/css/AdminLTE.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="../../../dist/css/skins/_all-skins.min.css">
<link rel="stylesheet" href="../device_manager/css/device.css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body clbass="hold-transition skin-blue">
	<div class="wrapper" ng-app ="deviceApp" ng-controller="deviceController" >
	<div class="content-wrapper content-wrapper-custom">
		<section class="content-header">
			<h1>设备管理</h1>
			<ol class="breadcrumb">
				<li><a href="#"><i class="fa fa-home"></i> 首页</a></li>
				<li class="">资源管理</li>
				<li class="active">监控设备管理</li>
			</ol>
		</section>
		<section class="content">
		<!-- 查询表单  begin-->
		<div class="row">
			<div class="col-xs-12">
				<div class="box" style="margin-top: 10px">
					<div class="box-header">
						<h3 class="box-title">查询条件</h3>
					</div>
					<div class="box-body">
						<!-- form start -->
						<form id="queryForm_device" class="form-horizontal">
							<div class="row">
								<div class="col-xs-4 ">
									<div class="form-group">
										<label for="code_query_device"
											class="control-label col-xs-4 padding-0">
											监控设备编码
										</label>
										<div class="col-xs-8 ">
											<input class="form-control input-sm padding-0" type="text"
												id="code_query_device" name="code_query_device"
												placeholder="输入监控设备编码" />
										</div>
									</div>
								</div>
								<div class="col-xs-4 ">
									<div class="form-group ">
										<label for="name_query_device"
											class="col-xs-4 control-label padding-0">
											监控设备名称
										</label>
										<div class="col-xs-8 ">
											<input class="form-control input-sm padding-0" type="text"
												id="name_query_device" name="name_query_device"
												placeholder="输入设备类型名称" />
										</div>
									</div>
								</div>
								<div class="col-xs-4 ">
									<div class="form-group">
										<label for="device_type_query_device" 
											class="control-label col-xs-4  padding-0">
											设备类型
										</label> 
										<div class="col-xs-8">
											<select id="device_type_query_device" name="device_type_query_device"
												class="selectpicker show-tick form-control">
												<option value="" selected></option>
												<option ng-repeat="deviceType in deviceTypeList" value="{{deviceType.type_id}}">
													{{deviceType.name}}</option>
											</select>
										</div>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-4 ">
									<div class="form-group">
										<label for="is_use_query_device" 
											class="control-label col-xs-4  padding-0">
											在用状态
										</label> 
										<div class="col-xs-8">
											<select id="is_use_query_device" name="is_use_query_device"
												class="selectpicker show-tick form-control">
												<option value="" selected></option>
												<option value="0">在用</option>
												<option value="1">弃用</option>
											</select>
										</div>
									</div>
								</div>
								<div class="col-xs-4 ">
									<div class="form-group">
										<label for="plane_id_query_device" 
											class="control-label col-xs-4  padding-0">
											归属飞机
										</label> 
										<div class="col-xs-8">
											<select id="plane_id_query_device" name="plane_id_query_device"
												class="selectpicker show-tick form-control">
												<option value="" selected></option>
												<option ng-repeat="plane in planeList" value="{{plane.plane_id}}">
													{{plane.name}}</option>
											</select>
										</div>
									</div>
								</div>
								<div class="col-xs-4 ">
									<div class="form-group">
										<label for="org_id_query_device" 
											class="control-label col-xs-4  padding-0">
											归属组织
										</label> 
										<div class="col-xs-8">
											<select id="org_id_query_device" name="org_id_query_device"
												class="selectpicker show-tick form-control">
												<option value="" selected></option>
												<option ng-repeat="org in orgList" value="{{org.org_id}}">
													{{org.name}}</option>
											</select>
										</div>
									</div>
								</div>
							</div>
							<div class="row" align="right">
								<div class="col-xs-8 ">
								</div>
								<div class="col-xs-4 ">
									<div class="form-group">
										<div class="col-xs-8" align=center>
											<button type="submit" class="btn btn-default  margin-5"
												id="queryBtn_device" ng-click="query()">查询设备</button>
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!-- 查询表单  end-->
		
		
		<!-- 表格结果显示 -->
		<div class="row" style="padding: 0px">
			<div class="col-xs-3" style="padding-right: 0px;">
				<div class="box">
					<div class="box-body">
						<div class="zTreeDemoBackground left">
							<ul id="treeDemo" class="ztree"></ul>
						</div>
					</div>
				</div>
				
			</div>
			<div class="col-xs-9" style="padding-left: 12px">
				<div class="box" style="padding:10px">
					<div class="box-body">
						<div>
							<button type="submit" class="btn btn-default  margin-5"
								data-toggle="modal" data-target="#addModal_device">新增</button>
							<button type="submit" class="btn btn-default  margin-5"
								ng-click="update_init()">修改</button>
							<button type="submit" class="btn btn-default  margin-5" 
								ng-click ="del_init()">删除</button>
						</div>
						<table id="device_table"
							class="table table-bordered table-striped table-condensed" style="margin-top: 5px">
							<thead>
								<tr>
									<th width="5px"><input name="items" type="checkbox" id="checkall_device" /></th>
									<th>设备ID</th>
									<th>设备编码</th>
									<th>设备类型</th>
									<th>修改时间</th>
									<th>是否在用</th>
									<th>归属组织</th>
									<th>上级设备</th>
									<th>归属飞机</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
		</div>
		</section>
	</div>
	<div class="modal fade" id="alertModal_device" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true" align="center">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
				<div class="modal-body">
					<div id="selAlert_device" class="alert alert-danger form-group" style="margin-top: 10px" 
						role="alert" align="center">
							<strong>请选择记录进行删除！</strong>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="addModal_device" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true" >
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">新增</h4>
				</div>
				<div class="modal-body">
					<form id="addForm_device" class="form-horizontal">
						<div class="col-xs-12">
							<div id="addSuccessAlert_device" class="alert alert-success form-group" 
								role="alert" hidden="true" align="center">
   								<strong>新增成功！</strong>
							</div>
						</div>
						<div class="col-xs-12">
							<div id="addFailedAlert_device" class="alert alert-danger form-group" 
								role="alert" hidden="true" align="center">
   								<strong>新增失败！</strong>
							</div>
						</div>
						
						<div class="form-group" >
							<label for="type_id_device"  
								class="control-label col-xs-3 padding-0">
								设备类型
							</label>
							<div class="col-xs-9">
								<select id="type_id_device" name="type_id_device" 
									class="selectpicker show-tick form-control" >
									<option value="" selected></option>
									<option ng-repeat="deviceType in deviceTypeList" value={{deviceType.type_id}}>
										{{deviceType.name}}
									</option>
								</select>
							</div>
							
						</div>
						<div class="form-group">
							<label for="parent_id_device"  
								class="control-label col-xs-3 padding-0">
								父设备名称
							</label>
							<div class="col-xs-9">
								<select id="parent_id_device" name="parent_id_device" 
									class="selectpicker show-tick form-control" >
									<option value="" selected></option>
									<option ng-repeat="device in deviceList" value={{device.device_id}}>
										{{device.name}}
									</option>
								</select>
							</div>
							
						</div>
						<div class="form-group">
							<label for="name_device"  
								class="control-label col-xs-3 padding-0">
								设备名称
							</label>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="name_device" name = "name_device"
									placeholder="设备名称">
							</div>
						</div>
						<div class="form-group">
							<label for="code_device"  
								class="control-label col-xs-3 padding-0">
								设备编码
							</label>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="code_device" name = "code_device"
									placeholder="设备编码">
							</div>
							
						</div>
						<div class="form-group">
							<label for="is_use_device"  
								class="control-label col-xs-3 padding-0">
								是否在用
							</label>
							<div class="col-xs-9">
								<select id="is_use_device" name="is_use_device"
									class="selectpicker show-tick form-control">
									<option value="0">在用</option>
									<option value="1">弃用</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="is_air_device"  
								class="control-label col-xs-3 padding-0">
								是否机载设备
							</label>
							<div class="col-xs-9">
								<select id="is_air_device" name="is_air_device" 
									class="selectpicker show-tick form-control" >
									<option value="1" >是</option>
									<option value="0" >否</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="org_id_device"  
								class="control-label col-xs-3 padding-0">
								所属组织
							</label>
							<div class="col-xs-9">
								<select id="org_id_device" name="org_id_device"
									class="selectpicker show-tick form-control">
									<option ng-repeat="org in orgList" value={{org.org_id}}>
										{{org.name}}
									</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="org_id_device"  
								class="control-label col-xs-3 padding-0">
								归属飞机
							</label>
							<div class="col-xs-9">
								<select id="plane_id_device" name="plane_id_device"
									class="selectpicker show-tick form-control">
									<option value="" selected></option>
									<option ng-repeat="plane in planeList" value={{plane.plane_id}}>
										{{plane.name}}
									</option>
								</select>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="submit" class="btn btn-primary" id="save" ng-click="add()">保存</button>
				</div>
			</div>
			
		</div>
	</div>
	<div class="modal fade" id="updateModal_device" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true" >
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">修改</h4>
				</div>
				<div class="modal-body">
					<form id="updateForm_device" class="form-horizontal">
						<input hidden="true" id="device_id_update_device" name="device_id_update_device" 
							value="{{device_id_update}}">
						<div class="col-xs-12">
							<div id="updateSuccessAlert_device" class="alert alert-success form-group" 
								role="alert" hidden="true" align="center">
   								<strong>修改成功！</strong>
							</div>
						</div>
						<div class="col-xs-12">
							<div id="updateFailedAlert_device" class="alert alert-danger form-group" 
								role="alert" hidden="true" align="center">
   								<strong>修改失败！</strong>
							</div>
						</div>
						<div class="form-group">
							<label for="type_id_update_device"  
								class="control-label col-xs-3 padding-0">
								设备类型
							</label>
							<div class="col-xs-9">
								<select id="type_id_update_device" name="type_id_update_device"
									class="selectpicker show-tick form-control">
									<option value="{{type_id_update}}" selected>{{type_name_update}}</option>
									<option ng-repeat="deviceType in deviceTypeList"
										value={{deviceType.type_id}}>{{deviceType.name}}</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="parent_id_update_device"  
								class="control-label col-xs-3 padding-0">
								父设备名称
							</label>
							<div class="col-xs-9">
								<select id="parent_id_update_device" name="parent_id_update_device" 
									class="selectpicker show-tick form-control" >
									<option value="{{parent_id_update}}" selected>{{parent_name_update}}</option>
									<option ng-repeat="device in deviceList" value={{device.device_id}}>
										{{device.name}}
									</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="name_update_device"  
								class="control-label col-xs-3 padding-0">
								设备名称
							</label>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="name_update_device" name = "name_update_device"
									value="{{name_update}}" placeholder="设备名称">
							</div>
							
						</div>
						<div class="form-group">
							<label for="code_update_device"  
								class="control-label col-xs-3 padding-0">
								设备编码
							</label>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="code_update_device" name = "code_update_device"
									value="{{code_update}}" placeholder="设备编码">
							</div>
							
						</div>
						<div class="form-group">
							<label for="is_use_update_device"  
								class="control-label col-xs-3 padding-0">
								是否在用
							</label>
							<div class="col-xs-9">
								<select id="is_use_update_device" name="is_use_update_device"
									class="selectpicker show-tick form-control">
									<option value="{{is_use_update}}" selected>{{is_use_update==1?'弃用':'在用'}}</option>
									<option value="0">在用</option>
									<option value="1">弃用</option>
								</select>
							</div>
							
						</div>
						<div class="form-group">
							<label for="is_air_update_device"  
								class="control-label col-xs-3 padding-0">
								是否机载设备
							</label>
							<div class="col-xs-9">
								<select id="is_air_update_device" name="is_air_update_device" 
									class="selectpicker show-tick form-control" >
									<option value="{{is_air_update}}" selected>{{is_air_update==1?'是':'否'}}</option>
									<option value="1" >是</option>
									<option value="0" >否</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="org_id_update_device"  
								class="control-label col-xs-3 padding-0">
								组织机构
							</label>
							<div class="col-xs-9">
								<select id="org_id_update_device" name="org_id_update_device"
									class="selectpicker show-tick form-control">
									<option value="{{org_id_update}}" selected>{{org_name_update}}</option>
									<option ng-repeat="org in orgList" value={{org.org_id}}>
										{{org.name}}
									</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="plane_id_update_device"  
								class="control-label col-xs-3 padding-0">
								所属飞机
							</label>
							<div class="col-xs-9">
								<select id="plane_id_update_device" name="plane_id_update_device"
									class="selectpicker show-tick form-control">
									<option value="{{plane_id_update}}" selected>{{plane_name_update}}</option>
									<option value=""></option>
									<option ng-repeat="plane in planeList" value={{plane.plane_id}}>
										{{plane.name}}
									</option>
								</select>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="submit" class="btn btn-primary" ng-click="update()">修改</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 删除提示模态框 -->
	<div class="modal fade" id="delModal_device" tabindex="-1" role="dialog" 
   		aria-labelledby="myModalLabel" aria-hidden="true" align="center">
   		<div class="modal-dialog">
      		<div class="modal-content">
         		<div class="modal-header">
            		<button type="button" class="close" 
               			data-dismiss="modal" aria-hidden="true">
							&times;
					</button>
            		<h4 class="modal-title" id="myModalLabel">
               			删除提示
            		</h4>
         		</div>
         		<div class="modal-body" align="center">
         			<div id="deleteSuccessAlert_device" class="alert alert-success form-group" 
         				role="alert" hidden="true" align="center">
   						<strong>删除成功！</strong>
					</div>
					<div id="deleteFailedAlert_device" class="alert alert-danger form-group" 
						role="alert" hidden="true" align="center">
   						<strong>删除失败！</strong>
					</div>
					<div id="promptContent_device">确认删除？</div>
            		
         		</div>
         		<div class="modal-footer">
            		<button type="button" class="btn btn-default"  
			             data-dismiss="modal">关闭
            		</button>
            		<button id="del_device" type="button" class="btn btn-primary" ng-click="del()">
               			确认删除
            		</button>
         		</div>
      		</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>
	</div>
	
	<!-- 删除提示模态框 -->
	<!-- jQuery 2.1.4 -->
	<script src="../../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<!-- Bootstrap 3.3.5 -->
	<script src="../../../bootstrap/js/bootstrap.min.js"></script>
	<!-- DataTables -->
	<script src="../../../plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="../../../plugins/datatables/dataTables.bootstrap.min.js"></script>
	<!-- SlimScroll -->
	<script src="../../../plugins/slimScroll/jquery.slimscroll.min.js"></script>
	<!-- FastClick -->
	<script src="../../../plugins/fastclick/fastclick.min.js"></script>
	<!-- AdminLTE App -->
	<script src="../../../dist/js/app.min.js"></script>
	<script src="//cdn.bootcss.com/angular.js/1.5.5/angular.min.js"></script>
	<script src="//cdn.bootcss.com/zTree.v3/3.5.23/js/jquery.ztree.core.min.js"></script>
	<script src="../device_manager/js/device.js"></script>
	<!-- page script -->
</body>
</html>
